<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="#{webGlobal.url_template}/default/main.xhtml">
	<ui:define name="head">
		<link href="#{webGlobal.url_module}/team/r/css/main.css" rel="stylesheet" />
	</ui:define>
	
	<ui:define name="content">
		<div class="main-container" style="margin: 0 auto;">
			<div class="container" style="margin:200px auto;">
				<div class="panel panel-default">
					<h:messages warnStyle="color:orange;" infoStyle="color:green;" errorStyle="color:red;"/>
					
					<div class="panel-heading">
						<div class="row">
							<div class="col-md-4 h1 text-center">
								#{matchDetail.oneMatch.homeTeam.name}</div>
							<div class="col-md-4 h2 text-center">
								#{matchDetail.oneMatch.scoreHome} -
								#{matchDetail.oneMatch.scoreOutside}<br />#{matchDetail.oneMatch.status}
							</div>
							<div class="col-md-4 h1 text-center">#{matchDetail.oneMatch.outsideTeam.name}</div>
						</div>
					</div>
				</div>
		
				<div class="panel panel-default">
					<div class="panel-heading">Liste des évènements</div>
					
					<h:panelGroup rendered="#{matchDetail.listPlayerEvent.size() == 0}">
						<div class="panel-body">Aucun évènement</div>
					</h:panelGroup>
					<h:panelGroup rendered="#{matchDetail.listPlayerEvent.size() > 0}">
						<table class="table">
							<thead>
								<tr>
									<th style="text-align: center;">Joueur</th>
									<th style="text-align: center;">Evenement</th>
								</tr>
							</thead>
							<tbody>
								<ui:repeat var="event" value="#{matchDetail.listPlayerEvent}">
									<tr>
										<td>
										#{event.player.toString()}
										</td>
										<td>
											<h:panelGroup rendered="#{event.typeEventPlayer == 'goal'}">But pour son camp</h:panelGroup>
											<h:panelGroup rendered="#{event.typeEventPlayer == 'csc'}">But contre son camp</h:panelGroup>
											<h:panelGroup rendered="#{event.typeEventPlayer == 'yellowcard'}">Carton jaune</h:panelGroup>
											<h:panelGroup rendered="#{event.typeEventPlayer == 'redcard'}">Carton rouge</h:panelGroup>
										</td>
									</tr>
								</ui:repeat>
								<tr></tr>
							</tbody>
						</table>
					</h:panelGroup>
				</div>
				
				<h:form prependId="false">
					<h:commandButton action="#{matchDetail.goToBackDetailTournament()}"
						styleClass="btn btn-lg btn-primary btn-block" value="Retour au tournoi" />
				</h:form>
		    </div>
		</div>
 	</ui:define>
</ui:composition>
</html>